package com.bdqn.zhang.pojo;

import java.util.ArrayList;
import java.util.List;

/*工具类*/
public class Pages<T> {
    //总记录数
    private int totalCount;


    //每页显示的数据条数
    private int pageSix = 6;

    //总页数 n % 10 == 0 ? 1  n/10 : n/10+1
    private int totalPage;

    //当前页
    private int currentPage;

    //存储集合数据

    List<T> list = new ArrayList<>();
    //limit 偏移量 显示的条数

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getPageSix() {
        return pageSix;
    }

    public void setPageSix(int pageSixe) {
        this.pageSix = pageSixe;
    }

    public int getTotalPage() {
        return totalPage;
    }

    //自修改
    public void setTotalPage() {
        this.totalPage = totalCount % pageSix == 0 ? totalCount / pageSix : totalCount / pageSix + 1;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }
}
